\function{glade_require}
\synopsis{Ensure that a required library is available}
\usage{glade_require (String_Type library)}
\description
   Ensures that required library \var{library} is available.  If it
   is not already available, the function attempts to dynamically
   load a module that contains the handlers for that library.
\example
#v+
   glade_require("gnome");
#v-
\done

\function{glade_xml_new}
\synopsis{Create a new Glade XML object from a file}
\usage{GladeXML glade_xml_new (String_Type fname[, String_Type root[, String_Type domain]])}
\description
   Creates a new GladeXML object (and the corresponding widgets)
   from the XML file \var{fname}.  Optionally, it will only build
   the interface from the widget node \var{root} (if it is
   provided and not NULL).  This feature is useful if you only want
   to build, say, a toolbar or menu from the XML file, but not the
   window it is embedded in.  If it is provided and not NULL,
   \var{domain} specifies the translation domain for the XML file;
   otherwise, the default domain is used.

   \var{glade_xml_new} will search for file \var{fname} in three
   places.  First, it will look in the current directory.  Second,
   it will search along the path specified by the environment
   variable \var{SLGLADE_XML_PATH}.  Third, it will search along
   \slang's search path (i.e. the one returned by
   \var{get_slang_load_path}).

   Returns NULL on error.
\example
#v+
   variable xml = glade_xml_new("my_gui.glade");
#v-
\seealso{glade_xml_new_from_buffer}
\done

\function{glade_xml_new_from_buffer}
\synopsis{Create a new Glade XML object from a string}
\usage{GladeXML glade_xml_new_from_buffer (String_Type buffer[, String_Type root[, String_Type domain]])}
\description
   Creates a new GladeXML object (and the corresponding widgets)
   from the string \var{buffer}.  Optionally, it will only build
   the interface from the widget node \var{root} (if it is
   provided and not NULL).  This feature is useful if you only want
   to build, say, a toolbar or menu from the XML file, but not the
   window it is embedded in.  If it is provided and not NULL,
   \var{domain} specifies the translation domain for the XML;
   otherwise, the default domain is used.

   Returns NULL on error.
\example
#v+
   variable fp = fopen("my_gui.glade","r");
   variable xml_str = "";
   foreach (fgetslines(fp))  xml_str += ();
   () = fclose(fp);

   variable xml = glade_xml_new_from_buffer(xml_str);
#v-
\seealso{glade_xml_new}
\done

\function{glade_xml_signal_connect}
\synopsis{Connect a signal handler}
\usage{glade_xml_signal_connect (GladeXML self, String_Type handlername, Ref_Type func[, Any_Type data, ...])}
\description
   In Glade interface descriptions, signal handlers are specified
   for widgets by name.  This function connects \slang function
   \var{func} to all signals in the Glade XML file with signal
   handler name \var{handlername}.  If more than three arguments
   are provided, the extra arguments will be passed to \var{func}
   when it is called.
\example
#v+
   define my_destroy() {
      variable msg = "You called my_destroy()!";
      if (_NARGS == 2)  (,msg) = ();
      message(msg);
      gtk_main_quit();
   }

   variable xml = glade_xml_new("my_gui.glade");
   glade_xml_signal_connect(xml,"gtk_main_quit",&my_destroy);
   glade_xml_signal_connect(xml,"gtk_widget_destroy",&my_destroy,"You destroyed me!");
#v-
\seealso{glade_xml_signal_autoconnect}
\done

\function{glade_xml_signal_autoconnect}
\synopsis{Connect all signal handlers}
\usage{glade_xml_signal_autoconnect (GladeXML self)}
\description
   In Glade interface descriptions, signal handlers are specified
   for widgets by name.  This function tries to match each
   signal-handler name in the Glade XML file with a \slang
   function of the same name.  If a matching function is found,
   it is connected to the appropriate signals.  Otherwise, a
   warning message is issued, and no handler is connected for
   signals with that handler name.
\example
#v+
   variable xml = glade_xml_new("my_gui.glade");
   glade_xml_signal_autoconnect(xml);
#v-
\seealso{glade_xml_signal_connect}
\done

\function{glade_xml_get_widget}
\synopsis{Retrieve a widget by name}
\usage{GtkWidget glade_xml_get_widget (GladeXML self, String_Type name)}
\description
   Retrieves the GtkWidget corresponding to \var{name} in the interface
   description.  You would use this if you have to do anything to the
   widget after loading.

   If a widget matching \var{name} cannot be found, the function will
   return NULL.
\example
#v+
   variable xml = glade_xml_new("my_gui.glade");
   variable win = glade_xml_get_widget(xml,"window1");
   () = g_signal_connect(win,"destroy",&gtk_main_quit);
#v-
\seealso{glade_xml_get_widget_prefix}
\done

\function{glade_xml_get_widget_prefix}
\synopsis{Retrieve all widgets matching prefix}
\usage{GtkWidget[] glade_xml_get_widget_prefix (GladeXML self, String_Type prefix)}
\description
   Returns an array of all GtkWidgets with names that start with
   \var{prefix} in the interface description.  You would use this if
   you have to do something to all of these widgets after loading.
   If \var{prefix} is the empty string or NULL, the function will
   return all widgets in the interface.

   If no widgets matching \var{prefix} can be found, the function will
   return NULL.
\example
#v+
   variable xml = glade_xml_new("my_gui.glade");
   variable windows = glade_xml_get_widget_prefix(xml,"window");
#v-
\seealso{glade_xml_get_widget}
\done

\function{glade_get_widget_name}
\synopsis{Get the name of a widget}
\usage{String_Type glade_get_widget_name (GtkWidget widget)}
\description
   Returns the name of a widget that was generated by a GladeXML object.
\example
#v+
   variable xml = glade_xml_new("my_gui.glade");
   variable windows = glade_xml_get_widget_prefix(xml,"window");
   variable first_win_name = glade_get_widget_name(windows[0]);
#v-
\seealso{glade_get_widget_tree}
\done

\function{glade_get_widget_tree}
\synopsis{Get the Glade XML object for a widget}
\usage{GladeXML glade_get_widget_tree (GtkWidget widget)}
\description
   Returns the GladeXML object that built the given widget.
\example
#v+
   variable xml = glade_xml_new("my_gui.glade");
   variable win = glade_xml_get_widget(xml,"window1");
   variable xml_again = glade_get_widget_tree(win);
#v-
\seealso{glade_get_widget_name}
\done

\variable{_glade_module_doc_dir}
\synopsis{SLglade installed documentation directory}
\usage{String_Type _glade_module_doc_dir}
\description
   \var{_glade_module_doc_dir} is a read-only variable whose value
   specifies the installation directory of the SLglade
   documentation.
\seealso{get_doc_string_from_file}
\done

